define([ "PDUtilDir/grid", "PDUtilDir/searchBlock", "PDUtilDir/slidebar" ],
		function(Grid, SearchBlock, Slidebar) {

			function init(cache, addObj, updateObj, delObj, searchObj) {
				SearchBlock.init('searchBlockId');
				// 初始化
				return Grid({
					id : "AccountGirdDivId",
					pageSize : 10,
					index : true,
					multi : true,
					pagination : true,
					cache : false,
					layout : [ {
						name : "所属人",
						field : "personName",
						sort : true,
						click : function(e) {
							updateObj.run(e.data.row);
						}
					}, {
						name : "账号",
						field : "accountNumber",
						sort : true
					}, {
						name : "电话",
						field : "personPhone",
						width : "10%"
					}, {
						name : "类型",
						field : "type",
						format:function(e){
							if(!cache.types)
								return;
							for(var i=0;i<cache.types.length;i++){
								if(cache.types[i].dictCode==e.row.type){
									return cache.types[i].dictName;
								}
							}
						}
					}, {
						name : "部门",
						field : "uuid"
					}, {
						name : "创建人",
						field : "createUser"
					}, {
						name : "创建时间",
						field : "createTime"
					} ],
					toolbar : [ {
						name : "添加",
						icon : "fa fa-plus-circle",
						callback : function(event) {
							addObj.run();
						}
					}, {
						name : "删除",
						icon : "fa fa-trash-o",
						callback : function(event) {
							delObj.run();
						}
					}/*, {
						name : "查询",
						icon : "fa fa-search",
						callback : function(event) {
						    searchObj.run();
						}
					}*/ ]
//				,
//					data : {
//						type : 'URL',
//						value : getServer() + '/flea/hclv/qr/manage/selectByDeptId.htmls'
//					}
				});
			}
			return {
				init : init
			}
		});